<%if params[:category_id].to_i == cat.id.to_i%>
<span class=selected_label>
<%else%>
<span class=label id=label_<%=cat.id%> onmouseover="$('label_<%=cat.id%>').style.background='#F0F0F0'" onmouseout="$('label_<%=cat.id%>').style.background='#E5E5E5'">
<%end%>

<!--show size information-->
<%if project%>
  <%size = (users = Project.find(project).roled_users(cat.id)).size%>

  <%if size > 0%>
   <%=image_tag("arrow_right.gif",:border=>0,:id=>"arrow_" + cat.id.to_s)%>
   <%=image_tag("arrow_bellow.gif",:border=>0,:id=>"arrow_b_" + cat.id.to_s,:style=>"display:none")%>
   <%=link_to cat.identifier,"#",:onclick=>"Element.toggle('people_#{cat.id}');Element.toggle('arrow_#{cat.id}');Element.toggle('arrow_b_#{cat.id}')"%>(<%=size%>)
   <div id="people_<%=cat.id%>" style="display:none;border:1px #ccc dashed;padding-left:10px">
    <%users.each do |u|%>
    <%=image_tag("person_icon.gif",:border=>0)%> 
    <%=u.name%><br/>
    <%end%>
  </div>
  <%else%>
  <%=image_tag("arrow_blank.gif",:border=>0,:id=>"arrow_" + cat.id.to_s)%> 
  <%=link_to cat.identifier,"#"%>(<%=size%>)
  <%end%>
<%else%>
  <%=link_to cat.identifier,"#"%>
<%end%>
</span>

 <!--admin area-->
 <span class='edit_item' id="edit_item_<%=cat.id%>"> 
 <%if (project && size==0) || project.nil? %>
   <%=link_to_remote image_tag("trash.gif",:border=>0),
	:confirm=>'Are you sure?'.t,
	:loading=>"Element.show('indicator_#{cat.id}');Element.hide('edit_item_#{cat.id}');new Effect.Highlight('cat_item_#{cat.id}')",
	:complete =>"Element.hide('indicator')",
	:url=>delete_role_path(cat.id)
   %>
 <%else%>
   &nbsp;
   &nbsp;
 <%end%>
<%=link_to_remote "Rename".t, 
	:update=>'cat_item_' + cat.id.to_s,
	:loading=>"Element.show('indicator_#{cat.id}');Element.hide('edit_item_#{cat.id}')",
        :url=>edit_role_path(cat.id)
%>
</span>
<span class='edit_item'>
<%=indicator(cat.id)%>
</span>

